﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ZH.GPT.Domains.ChatMessage.Request;
using ZH.GPT.Domains.ChatMessage.Response;
using ZH.GPT.Domains.Completions.Request;

namespace ZH.GPT.Services.Interface
{
    public interface IChatService
    {
        public List<RoleResponsePDTO> ListRoles { get; }

        List<string> GetModels();

        /// <summary>
        /// 获取所有模型
        /// </summary>
        /// <returns></returns>
        public List<ModelPDTO> GetModel();
        public Task<(bool isSucc,string id )> CreateChatAsync(string userId,string role,string model);

        /// <summary>
        /// 获取消息
        /// </summary>
        /// <param name="chatMessage">消息id</param>
        /// <returns></returns>
        Task<ChatMessagesPDTO> GetChatMessageAsync(ChatMessageQDTO chatMessage);
        /// <summary>
        /// 创建多条聊天信息
        /// </summary>
        /// <param name="msgQdto"></param>
        /// <param name="v"></param>
        /// <returns></returns>
        Task<bool> AddChatMessageAsync(CompletionsQDTO msgQdto, string v,int consumedTokenNum);

        /// <summary>
        /// 新增消息
        /// </summary>
        /// <param name="chatMessage"></param>
        /// <returns></returns>
        Task<(bool, string)> AddChatMessageAsync(ChatMessageDTO chatMessage);
        /// <summary>
        /// 用户聊天列表
        /// </summary>
        /// <param name="chatId"></param>
        /// <returns></returns>
        Task<List<ChatPDTO>> GetChatsAsync(string userId);
        /// <summary>
        /// 检查token
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<bool> CheckBalanceToken(string userId);
    }
}
